<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>
  <div>ssss</div>
</template>

<script>

  import {authlogin} from '@/framework-core/api/login'

  export default {
    name: 'authredirect',
    data() {
      return {
        temptoken: "",
      };
    },
    created() {
      debugger
      const params = this.$route.query
      this.authloginCheck( params.temptoken);
    },
    methods: {
      authloginCheck(temptoken) {
        let $that = this;
        this.$store.dispatch("LoginByToken", temptoken).then((res) => {
          if ($that.$route.query.redirect) { //如果存在参数
            debugger
            let redirect = $that.$route.query.redirect;
            $that.$router.push(redirect);//则跳转至进入登录页前的路由
          } else {
            $that.$router.push('/');//否则跳转至首页
          }
        }).catch((res) => {
                  if (res.data.success) {
                    $that.$router.push({
                      name: 'login',
                      query: {"temptoken": res.data.data.temptoken}
                    });
                  } else {

                  }

                }
        );
      }
    }
  }
</script>


<style>
</style>
